import axios from '@/lib/axios'
const $API = '/api'

// 加载初始化
const initSystem = data => axios.get(
  // key：score_desc积分规则
  `${$API}/common/init`,
  data,
)

// 首页菜单
const getIndexMenu = data => axios.get(
  `${$API}/index/getMenu`,
  data,
)

// 获取常见问题
const getquestionsList = data => axios.get(
  `${$API}/user/getquestionsList`,
  data,
)

// 根据广告位标记获取广告位信息
const getBannerByMark = data => axios.get(
  `${$API}/adszone/getAdsByMark`,
  data,
)

// 获取基本信息
const getBaseInfo = data => axios.post(
  `${$API}/common/getBaseInfo`,
  data,
)

// 获取部门数据
const getDepartment = data => axios.get(
  `${$API}/common/getDepartment`,
  data,
)

// 关注公众号微信二维码
const getQrcodeFollow = data => axios.post(
  `${$API}/common/getWechat`,
  data,
)

// 根据经纬度获取具体位置
const getLocation = data => axios.post(
  `${$API}/common/getRealyAddress`,
  data,
)

// 获取基本信息
const getBasicInfo = data => axios.post(
  // key：score_desc积分规则
  `${$API}/common/getBaseInfo`,
  data,
)

// 查询七牛转换状态
const searchChangeFile = data => axios.post(
  // key：score_desc积分规则
  `${$API}/common/SearchFile`,
  data,
)

// 获取外链的图片和标题
const getOutLinkInfo = data => axios.post(
  // key：score_desc积分规则
  `${$API}/common/getLink`,
  data,
)

// 获取用户组
const getUserGroup = data => axios.post(
  `${$API}/index/getUserGroup`,
  data,
)

// 三级地区列表
const getAreaList = data => axios.post(
  `${$API}/area/list`,
  data,
)

export default {
  initSystem,
  getIndexMenu,
  getquestionsList,
  getBannerByMark,
  getBaseInfo,
  getDepartment,
  getQrcodeFollow,
  getLocation,
  getBasicInfo,
  searchChangeFile,
  getOutLinkInfo,
  getUserGroup,
  getAreaList,
}
